package com.tjbklx1.pattern.singleton.demo1;

/**
 * 线程不安全的单例模式
 * 
 * @author tjbklx1
 * @date 2018-10-10
 */
public class SingletonUnsafe {
	private static SingletonUnsafe singleton = null;

	// 限制产生多个对象
	private SingletonUnsafe() {
	}

	// 通过该方法获得实例对象
	public static SingletonUnsafe getSingleton() {
		if (singleton == null) {
			singleton = new SingletonUnsafe();
		}
		return singleton;
	}
}